package com.scm.core.listener;

import java.io.IOException;
import java.util.Properties;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.scm.utils.UploadAndDownUtil;



public class AppContextListener implements  ServletContextListener {

	@Override
	public void contextDestroyed(ServletContextEvent event) {
	
		
	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		ServletContext sv =  event.getServletContext();
		Properties p = new Properties();
		try {
			p.load(UploadAndDownUtil.class.getClassLoader().getResourceAsStream("config.properties"));
			String accessFileUrl = p.getProperty("accessFileUrl");
			sv.setAttribute("accessFileUrl", accessFileUrl);
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		sv.setAttribute("systemName", "集合制造办公管理后台");
	}

}
